Fix profile import silently leaving some mods uninstalled #1647
+48
−45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To reduce time spent on the splash screen, recent changes skip refreshing the online mod list if older version is found in IndexedDB cache. This means the user might have outdated mod list when importing a profile, and the manager can't import mods it doesn't know about. To mitigate the issue, a warning was added to profile preview step with an option for the user to update the mod list.
However, the warning uses the mod list in Vuex to check if a mod is available, which is a mistake since that only checks if the mod itself is known, and not whether the mod version in the profile is known. This caused recently updated mods to not always trigger the warning. The download part uses IndexedDB as its source of truth, and silently ignored the unknown mods/versions, since user has explicitly decided to import a partial profile.
To fix the issue, both parts now use IndexedDB as the source of truth.
The implementation in ImportProfileModal now somewhat akwardly handles the mod information as ExportMods (read from mods.yml and required to know which mods are disabled), ThunderstoreMods (required to use existing UI components), and ThunderstoreCombos (required to download a specific version of the mod). This could potentially be simplified but is outside the scope of this PR.
ExportMod support was dropped from TsModsModule functions to remove the footgun that caused this whole problem.